package com.cloudpivot.project.crmprojectnew.view;

import lombok.Getter;
import lombok.Setter;

/**
 * 医院的 枚举
 */
public enum HospitalEnum {
    ONE("31", "三甲"),
    TWO("32", "三乙"),
    THREE("33", "三丙"),
    ;

    @Getter
    @Setter
    private String k;
    @Getter
    @Setter
    private String v;

    HospitalEnum(String k, String v) {
        this.k = k;
        this.v = v;
    }

    public static String getValue(String k) {
        if (k == null) {
            return null;
        } else {
            for (HospitalEnum eNum : HospitalEnum.values()) {
                if (k.equals(eNum.getK())) {
                    return eNum.getV();
                }
            }
        }
        return null;
    }

    public static String getKey(String v) {
        if (v == null) {
            return null;
        } else {
            for (HospitalEnum eNum : HospitalEnum.values()) {
                if (v.equals(eNum.getV())) {
                    return eNum.getK();
                }
            }
        }
        return null;
    }

}
